<!--  -->
<template>
    <view>
        <view class="list">
            <view class="list-item" v-for="item in list" @click="toDetails(item)">
                <image :src="item.img" />
                <view class="list-item-info">
                    <view class="list-item-title">{{ item.name }}</view>
                    <view>种植时间：{{ item.time }}</view>
                    <view>作物：{{ item.cp }}</view>
                    <view>品种：{{ item.type }}</view>
                    <view>已添加批次：{{ item.num }}</view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
    //import引入的组件需要注入到对象中才能使用
    components: {},
    data() {
        //这里存放数据
        return {
            list: [
                {
                    name: "苹果",
                    time: "2021-10-02",
                    cp: "苹果",
                    type: "青苹果",
                    num: "10",
                    img: "/static/shuiguo_2.png",
                },
                {
                    name: "香蕉",
                    time: "2021-10-02",
                    cp: "香蕉",
                    type: "香蕉",
                    num: "10",
                    img: "/static/shuiguo_7.png",
                },
                {
                    name: "橘子",
                    time: "2021-10-02",
                    cp: "橘子",
                    type: "橘子",
                    num: "10",
                    img: "/static/shuiguo_3.png",
                },
                {
                    name: "苹果",
                    time: "2021-10-02",
                    cp: "苹果",
                    type: "青苹果",
                    num: "10",
                    img: "/static/shuiguo_2.png",
                },
                {
                    name: "香蕉",
                    time: "2021-10-02",
                    cp: "香蕉",
                    type: "香蕉",
                    num: "10",
                    img: "/static/shuiguo_7.png",
                },
                {
                    name: "苹果",
                    time: "2021-10-02",
                    cp: "苹果",
                    type: "苹果",
                    num: "10",
                    img: "/static/shuiguo_3.png",
                },
                {
                    name: "葡萄",
                    time: "2021-10-02",
                    cp: "葡萄",
                    type: "青葡萄",
                    num: "10",
                    img: "/static/shuiguo_8.png",
                },
                {
                    name: "香蕉",
                    time: "2021-10-02",
                    cp: "香蕉",
                    type: "香蕉",
                    num: "10",
                    img: "/static/shuiguo_5.png",
                },
                {
                    name: "苹果",
                    time: "2021-10-02",
                    cp: "苹果",
                    type: "青苹果",
                    num: "10",
                    img: "/static/shuiguo_2.png",
                },
                {
                    name: "香蕉",
                    time: "2021-10-02",
                    cp: "香蕉",
                    type: "香蕉",
                    num: "10",
                    img: "/static/shuiguo_7.png",
                },
                {
                    name: "橘子",
                    time: "2021-10-02",
                    cp: "橘子",
                    type: "橘子",
                    num: "10",
                    img: "/static/shuiguo_3.png",
                },
                {
                    name: "苹果",
                    time: "2021-10-02",
                    cp: "苹果",
                    type: "青苹果",
                    num: "10",
                    img: "/static/shuiguo_2.png",
                },
                {
                    name: "香蕉",
                    time: "2021-10-02",
                    cp: "香蕉",
                    type: "香蕉",
                    num: "10",
                    img: "/static/shuiguo_7.png",
                },
                {
                    name: "苹果",
                    time: "2021-10-02",
                    cp: "苹果",
                    type: "苹果",
                    num: "10",
                    img: "/static/shuiguo_3.png",
                },
                {
                    name: "葡萄",
                    time: "2021-10-02",
                    cp: "葡萄",
                    type: "青葡萄",
                    num: "10",
                    img: "/static/shuiguo_8.png",
                },
                {
                    name: "香蕉",
                    time: "2021-10-02",
                    cp: "香蕉",
                    type: "香蕉",
                    num: "10",
                    img: "/static/shuiguo_5.png",
                },
            ],
        };
    },

    //方法集合
    methods: {
        toDetails(row) {
            uni.navigateTo({
                url: "/pages/ck/syxx_xq?row=" + encodeURIComponent(JSON.stringify(row)),
            });
        },
    },
};
</script>
<style lang="scss" scoped>
.list-item {
    margin-top: 40rpx;
    background-color: #fff;
    display: flex;
    padding: 40rpx;
    &-info {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        color: #777;
        .list-item-title {
            font-size: 34rpx;
            color: #555;
            font-weight: 700;
        }
    }
    image {
        width: 240rpx;
        height: 240rpx;
        margin-right: 24rpx;
    }
}
</style>
